FROM java:8-alpine
#FROM openjdk:8-jdk-alpine
MAINTAINER zhujinrun

RUN mkdir /usr/share/fonts

#上传windows字体: C:\Windows\Fonts\simsun.ttc
#COPY chinese/simsun.ttc /usr/share/fonts
#RUN apk update && apk --no-cache add fontconfig && cd /usr/share/fonts && chmod -R 755 /usr/share/fonts/ && fc-cache -fv

#下载ttf字体文件： https://pfh-file-store.oss-cn-hangzhou.aliyuncs.com/simsun.ttf
#COPY chinese/simsun.ttf /usr/share/fonts
ADD https://pfh-file-store.oss-cn-hangzhou.aliyuncs.com/simsun.ttf /usr/share/fonts
RUN apk update && apk --no-cache add fontconfig && cd /usr/share/fonts && chmod -R 755 /usr/share/fonts/ && fc-cache -fv

# 直接挂载宿主机上的 tmp 目录使用，也可以使用 WORKDIR 来创建新的目录
VOLUME /tmp
ADD target/demo-0.0.1-SNAPSHOT.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","app.jar"]
